﻿// -----------------------------------------------------------------------
// <copyright file="NavigationService.cs" company="CompDJ">
//     Copyright (c) CompDJ. All rights reserved.
// </copyright>
// -----------------------------------------------------------------------

namespace T4DemoCs.Navigation
{
    using System;

    /// <summary>Navigation Service class</summary>
    public static class NavigationService
    {
        /// <summary>Navigation service holder (static and readonly for thread safety singleton).</summary>
        private static readonly INavigationService service;

        /// <summary>Initializes static members of the NavigationService class.</summary>
        [System.Diagnostics.CodeAnalysis.SuppressMessage(
            "Microsoft.Performance", 
            "CA1810:InitializeReferenceTypeStaticFieldsInline", 
            Justification = "It is using a singleton pattern, and cannot be set anywhere but the static constructor.")]
        static NavigationService()
        {
            NavigationService.service = new NavigationServiceImpl();
        }

        /// <summary>Gets the current navigation service</summary>
        public static INavigationService Current
        {
            get
            {
                return NavigationService.service;
            }
        }
    }
}
